package com.navinfo.gateway.platform.server.netty.codec;

import com.navinfo.gateway.platform.util.lang.ArraysUtils;
import com.sun.xml.internal.ws.api.message.Packet;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;

import java.util.ArrayList;
import java.util.List;

/**
 * Packet编码器
 *
 * @author zhengshibo
 * @date 2018/3/14.
 */
public class TcpEncoder extends MessageToByteEncoder<Packet> {

    private static final Logger log = LoggerFactory.getLogger(TcpEncoder.class);
    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, Packet packet, ByteBuf byteBuf) throws Exception {
        //todo
        //根据协议不同，去编写不同的编码代码，将对象转换成要发送的报文
        //例如下面注释的代码
        //todo
    }
}
